package day06;

public class People2 {
    private double weight;

    public double getWeight() {
        return weight;
    }

    public void setWeight(double weight) {
        this.weight = weight;
    }
public void eat(double food){
        weight+=food;
}

}
class Man extends People2{
    private Woman girlFriend;
    private double salarary;
public void lol(){
    System.out.println("我在玩元神,启动");
    this.girlFriend.shopping();
}
    public void eat(double food){
        super.eat(food);
        while(getWeight()>=200){
            sport();
        }
    }
    public void sport(){
        setWeight(getWeight()-5);
    }
    public Woman getGirlFriend() {
        return girlFriend;
    }
    public void setGirlFriend(Woman girlFriend) {
        this.girlFriend = girlFriend;
    }

    public double getSalarary() {
        return salarary;
    }

    public void setSalarary(double salarary) {
        this.salarary = salarary;
    }
}
class Woman extends People2{
private Man boyFriend;

    public Man getBoyFriend() {
        return boyFriend;
    }

    public void setBoyFriend(Man boyFriend) {
        this.boyFriend = boyFriend;
    }
    public void shopping(){
        System.out.println("我在购物中");
        this.boyFriend.setSalarary(this.boyFriend.getSalarary()-100);
    }
}
